home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_tkcvs.idb / usr / freeware / lib / tkcvs / commit.tcl.z / commit.tcl
Encoding:
Text File  |  1999-04-16  |  1.9 KB  |  76 lines

  1. #
  2. # Tcl Library for tkCVS
  3. #
  4.  
  5. # $Id: commit.tcl,v 1.11 1995/11/22 00:16:42 davide Exp $
  6. #
  7. # Set up a small commit dialog.
  8. #
  9.  
  10. proc commit_setup {} {
  11.   global cvsglb
  12.  
  13.   toplevel .commit
  14.   frame .commit.left
  15.   frame .commit.right
  16.   frame .commit.down -relief groove -border 2
  17.  
  18.   pack .commit.down -side bottom -fill x
  19.   pack .commit.left -side left -fill y
  20.   pack .commit.right -side left -fill both -expand 1
  21.  
  22.   label .commit.lvers -text "Version Number" -anchor w
  23.   label .commit.lcomment -text "Comment" -anchor w
  24.  
  25.   entry .commit.tvers -relief sunken -textvariable version
  26.   text  .commit.tcomment -relief sunken -width 70 -height 10 \
  27.     -wrap word -border 2 -setgrid yes
  28.  
  29.   # bind_motifentry .commit.tvers
  30.   # bind_motiftext  .commit.tcomment
  31.  
  32.   pack .commit.lvers .commit.lcomment -in .commit.left \
  33.     -side top -fill x -pady 3
  34.  
  35.   pack .commit.tvers -in .commit.right \
  36.     -side top -fill x -pady 3
  37.  
  38.   pack .commit.tcomment -in .commit.right \
  39.     -side top -fill both -expand 1 -pady 3
  40.  
  41.   button .commit.ok -text "OK" \
  42.     -command {
  43.       cvs_commit $version [.commit.tcomment get 1.0 end] $cvsglb(commit_list)
  44.       if {$cvscfg(auto_status) == "true"} {
  45.         setup_dir
  46.       }
  47.       wm withdraw .commit
  48.     }
  49.   button .commit.quit -text "Quit" -command { wm withdraw .commit }
  50.  
  51.   pack .commit.ok .commit.quit -in .commit.down -side left \
  52.     -ipadx 2 -ipady 2 -padx 4 -pady 4 -fill both -expand 1
  53.  
  54.   wm withdraw .commit
  55.   wm title .commit "Commit Changes to a Module"
  56.   wm minsize .commit 1 1
  57. }
  58.  
  59. proc commit_run {} {
  60.   global incvs
  61.   global cvsglb
  62.  
  63.   if {! $incvs} {
  64.     cvserror "This directory is not in CVS.\nPlease import it first."
  65.     return 1
  66.   }
  67.  
  68.   # If marked files, commit these.  If no marked files, then
  69.   # commit any files selected via listbox selection mechanism.
  70.   # The cvsglb(commit_list) list remembers the list of files
  71.   # to be committed.
  72.   set cvsglb(commit_list) [workdir_list_marked_files]
  73.   wm deiconify .commit
  74. }
  75.